﻿using System;
using System.Diagnostics;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System.IO;
using System.IO.IsolatedStorage;
using System.Xml.Linq;
using Microsoft.Xna.Framework.Input;

namespace chemicall
{

    public class PlayMenu : MenuScreen
    {

        public PlayMenu() : base("Jouer")
        {
            MenuItem playNewGameMenuEntry = new MenuItem("Nouvelle");
            MenuItem playLoadGameMenuEntry = new MenuItem("Reprendre");
            MenuItem backMenuEntry = new MenuItem("Retour");

            playNewGameMenuEntry.Selected += PlayNewGameMenuEntrySelected;
            playLoadGameMenuEntry.Selected += PlayLoadGameMenuEntrySelected;
            backMenuEntry.Selected += PlayMainMenuEntrySelected;

            MenuEntries.Add(playNewGameMenuEntry);
            MenuEntries.Add(playLoadGameMenuEntry);
            MenuEntries.Add(backMenuEntry);
        }

        void PlayNewGameMenuEntrySelected(object sender, System.EventArgs e)
        {
            this.ScreenManager.LastScreen = this;
            ScreenManager.AddScreen(new NewMenu(), PlayerIndex.One);
        }

        void PlayLoadGameMenuEntrySelected(object sender, System.EventArgs e)
        {
            this.ScreenManager.LastScreen = this;
            ScreenManager.AddScreen(new LoadMenu(), PlayerIndex.One);
        }

        void PlayMainMenuEntrySelected(object sender, System.EventArgs e)
        {            
            ScreenManager.AddScreen(this.ScreenManager.LastScreen, PlayerIndex.One);
            this.ScreenManager.LastScreen = this;
        }
    }
}
